﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Space_Conquest
{

    /// <summary>
    ///     Bring out yur dead!
    /// </summary>
    /// <remarks>
    ///     I'm not dead!
    ///     'Ere. He says he's not dead!
    ///     Yes he is.
    ///     I'm not!
    ///     He isn't?
    /// </remarks>
    class TheDeadCart
    {

        #region Private Members

        Stack<Unit> _pileOfBodies = new Stack<Unit>();
        GameEngine _parent;

        #endregion

        #region Properties

        public GameEngine Parent
        {
            get
            {
                return _parent;
            }
        }

        #endregion

        #region Constructors

        public TheDeadCart(GameEngine parent)
        {

            _parent = parent;

        }

        #endregion

        #region Methods

        public void StackBody(Unit body)
        {

            _pileOfBodies.Push(body);

        }

        public void DumpCart()
        {

            while (_pileOfBodies.Count > 0)
            {

                Parent.UnitManager.Units.Remove(_pileOfBodies.Peek());
                _pileOfBodies.Pop();

            }

        }

        #endregion

    }

}
